const mongoose = require('mongoose')
mongoose.connect('mongodb://localhost/myweb',{useNewUrlParser:true, useUnifiedTopology: true })

let Schema = mongoose.Schema

let commentSchema = new Schema({
    useremail:{
        type:String,
        required:true
    },
    nickname:{
        type:String,
        required:true
    },
    avatar:{
        type:String,
        default:'/public/images/avatar-default.png'
    },
    push_time:{
        type:Date,
        default:Date.new
    },
    content:{
        type:String,
        default:''
    }
})

module.exports = mongoose.model('Comment',commentSchema)